﻿using Electronic_work_order.Model;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using System.Linq;

namespace Electronic_work_order.Interfacess.OA_Expense_reimbursement_LEI
{
    public class Sql_Expense_reimbursement : IExpense_reimbursement
    {
        private readonly AppDbContext _context;

        public Sql_Expense_reimbursement(AppDbContext context)
        {
            _context = context;
        }

        //报销申请
        public int Addexpense_Reimbursement(Expense_reimbursement expense_Reimbursement)
        {
            _context.expense_Reimbursements.Add(expense_Reimbursement);
            return _context.SaveChanges();
        }

        //查询所有报销类型
        public IEnumerable<Expense_reimbursement_Type> Getexpense_Reimbursement_Types()
        {
            return _context.expense_Reimbursement_Types.ToList();
        }
    }
}
